//
//  DFNetWorkRequest.m
//  DownGuys
//
//  Created by zhanghongwei on 1/12/16.
//  Copyright © 2016年 down-guys. All rights reserved.
//

#import "DFNetWorkRequest.h"

/*
 * 整个项目中所有 网络请求ModeL类的基类
 */

@implementation DFNetWorkRequest


- (id)init
{
    self = [super init];
    
    if (self) {
        
        //requestWebApi , requestType 可在子类中重新进行负值
        
        //请求接口
        self.requestWebApi = @"";
        
        //暂时给一个默认值
        self.requestType = NetWork_Request_Type_GET;
        
        //请求 token
        self.access_token = @"";
        
        //uid
        //self.uid = @"";
        
        self.isEncode = YES;
        
        self.retryCount = 3;
    }
    
    return self;
}

//需要 过滤的参数
- (NSMutableArray*)ignoredKeys
{
    //过滤掉的参数
    NSMutableArray *ignoreds = [NSMutableArray arrayWithObjects:@"requestWebApi",@"requestType",@"access_token",@"isEncode",@"retryCount", nil];
    if (!self.uid || self.uid.length==0) {
        [ignoreds addObject:@"uid"];
    }
    
    return ignoreds;
}

- (NSMutableDictionary*)dicParamsIgnoredKeys
{
    //过滤掉的参数
    NSMutableArray *ignoreds = [self ignoredKeys];
    
    NSMutableDictionary *dicParams = [self mj_keyValuesWithIgnoredKeys:ignoreds];
    
    return dicParams;
}



@end
